def randomBoolean():
    import random

    for i in range(10):
        print bool(random.randint(0,1))

def strTest():
    print "alpha "\
        "beta"
    str2 = "zeta"
    print(len(str2))
    print r"a\nb"
    print 4*"ze"

def tupleTest():
    t1 = "a", "b", 4711
    t2 = ("a", "b", 4711)
    print t1
    print t2
    print 1 in t1
    print "b" in t1
    print 4711 not in t1
    print len(t1)
    print max(t1)
    print "min ", min(t1)
    print t1+t1
    
def indexingTest():
    five = 1,2,3,4,5
    print five[0]  # erstes
    print five[-1] # letztes, -2 = vorletztes
    print five[:]
    print five[1:3] # zweites bis und mit drittes
    print five[:2] # alle bis und mit zweites (ohne drittes)
    print five[:9]
    
def tupleMix():
    mix = (1, 2, "solaris", (1, 2, 3))
    print mix[3]
    print mix[3][2]    
    print (3+7)
    print (3+7,) # a tuple

def listTest():
    lsi = [4, 1, 3, 6, 1, -1, 1000]
    print lsi
    lsi.sort()
    print lsi
    lsi.reverse()
    print lsi.count(1)
    
def modList():
    l1 = [1, 2]
    l2 = [3, 4]

    l1.append(l2)
    print l1
    #others: einfuegen, killen
    l1.extend(l2)
    print l1
    print l1.pop(2)
    print l1
    # get positions
    print l1.index(1)
    print l1.index(4)
    print l1.index(5)
    
def conversion():
    lis = [1, 3, 4]
    tup = 1, 2, 3
    
    print lis
    print tup
    
    print tuple(lis)
    print list(tup)
    
    pass

def emptyFct():
    pass

def dictTest():
    words = { 'girl': 'Maedchen', 'house': 'Haus', 'death': 'Tod' }

    print words['house']

    print words.keys()
    print words.values()
    print words.items()

    print words.pop('girl')
    print words
    words.clear()
    print words
    
    pass

dictTest()
